package com.cslg.yougou.front.controller;
import com.cslg.yougou.front.pojo.Result;
import com.cslg.yougou.front.service.YougouMemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zyw
 * @since 2020-11-04
 */

@RestController
@Api(value="用户controller",tags={"微信用户操作接口"})
@RequestMapping("/front/member-api")
public class YougouMemberController {
    @Autowired
    YougouMemberService yougouMemberService;
    @GetMapping("/login")
    public Result login(@ApiParam(value = "code 微信唯一标识",required = true)String code,
                        @ApiParam(value = "需要解密的数据",required = true) String encryptedData,
                        @ApiParam(value = "解密向量iv") String iv, HttpServletRequest request){
        System.out.println("code:"+code+"encryptedData:"+encryptedData);
        return yougouMemberService.login(code,encryptedData,iv,request);
    }

}
